package com.dmxh.service.impl;

import com.dmxh.mapper.TbItemMapper;
import com.dmxh.pojo.TbItem;
import com.dmxh.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {
    @Autowired
    private TbItemMapper tbItemMapper;

    @Override
    public TbItem queryById(long id) {
        return tbItemMapper.selectByPrimaryKey(id);
    }

    @Override
    public void defStockCount(List<TbItem> list) {
        for (TbItem tbItem : list) {
            tbItemMapper.updateByPrimaryKeySelective(tbItem);
        }
    }

}
